<template>
	<!-- 首页 -->
	<view class="wrap" style="padding-bottom: 180rpx;">
		<view class="message-img" style="position: absolute;z-index: 1000;">
			<uni-transition :duration="1000" :mode-class="'slide-top'" :show="transShow">
				<navigator class="p_r " url="../componentsB/line/index" @click="messageChange">
					<image src="../../static/message-min.png"></image>
					<view :class="{'message-img-gif':isMessage}"></view>
				</navigator>
			</uni-transition>
		</view>
		<view class="head p_r">
			<uni-transition :duration="1800" :mode-class="'slide-right'" :show="transShow">
				<view
					style="position: absolute; top: 0; width: 100%; padding-top: 50rpx; padding-left: 30rpx; color: #ffffff; font-weight: bold; font-size: 40rpx">
					<text style="font-size: 36rpx">旅游记账和调研</text>
				</view>
			</uni-transition>

			<view style="height: 390rpx">
				<view style="position: absolute; top: 120rpx; left: 60rpx">
					<uni-transition :duration="1000" :mode-class="'slide-right'" :show="transShow">
						<text style="margin-bottom: 20rpx; font-weight: bold; font-size: 34rpx; color: #fff">HI,
							早上好</text>
					</uni-transition>
					<uni-transition :duration="500" :mode-class="'slide-bottom'" :show="transShow">
						<text style="margin-bottom: 20rpx;  font-size: 24rpx; color: #fff">记录让生活更美好</text>
					</uni-transition>
				</view>
				<image style="width: 100%; height:390rpx" src="../../static/backNone-min.png"></image>
			</view>
		</view>
		<view v-if="bookkeeping=='是'" class="tab" style="margin-bottom: 20rpx;">
			<uni-transition :duration="1000" :mode-class="'zoom-in'" :show="transShow">
				<view class="flex" v-if="user_type=='自然人' "
					style="background-color: #078AFE;width: 320rpx;border-top-right-radius: 15rpx;border-top-left-radius: 15rpx;">
					<view class=" fontWeight text24 default" :class="{'active':tabIndex==index}"
						@click="tabbarIndexChange(index)" v-for="(item,index) in tabListData" :key="index">{{item}}
					</view>
				</view>
				<view class="flex" v-if="user_type=='法人'"
					style="background-color: #078AFE;display: inline-block;border-top-right-radius: 15rpx;border-top-left-radius: 15rpx;">

				</view>
				<!-- 自然人有实时记账和一次性记账 -->
				<view class="" v-if="user_type=='自然人'">
					<!-- 再次判断当前自然人条件下是否存在记账 存在显示 不存在隐藏 -->
					<view>
						<view v-if="tabIndex==0" class="tab-content"
							style="width:710rpx;padding-bottom: 50rpx;padding-right: 20rpx;padding-left: 20rpx;border-bottom-right-radius: 15rpx;border-bottom-left-radius: 15rpx;border-top-right-radius: 15rpx;">
							<view class="tab-input flex Jbetween "
								style="width: 100%;padding-top: 10rpx;display: flex;flex-direction: column;">
								<view class="text24 fontWeight " style="color:#000000;margin: 20rpx;">本部分仅记录出游花费</view>
								<view class="" style="display: flex;justify-content: space-between;">
									<view class="tab-left flex Acenter" style="margin-bottom: 10rpx;">
										<view class="tab-img">
											<image style="width: 50rpx;height: 50rpx;" src="../../static/total.png"
												mode=""></image>
										</view>
										<text class="text30 fontWeight fontColor">本次出游总花费</text>
									</view>
									<view class="tab-right flex Acenter text36 fontWeight fontColor">
										￥{{totalMoney || 0}}</view>
								</view>
							</view>
							<uni-transition :duration="1500" :mode-class="'slide-right'" :show="transShow">
								<view style="display: flex;justify-content: space-between;">
									<button class="text30  fontWeight" type="default"
										style="width: 30%;margin-top: 10rpx;color: #FFFFFF;flex: 1;margin-right: 10rpx;"
										@click="urlSubmitButton">去记账</button>
									<button class="text30  fontWeight" type="default"
										style="width: 30%;margin-top: 10rpx;color: #FFFFFF;flex: 1;"
										@click="submitButton">一键提交</button>
								</view>
							</uni-transition>
						</view>
						<view v-if="tabIndex==1" class="tab-content"
							style="width:710rpx;padding-bottom: 50rpx;padding-right: 20rpx;padding-left: 20rpx;border-bottom-right-radius: 15rpx;border-bottom-left-radius: 15rpx;border-top-right-radius: 15rpx;">

							<view class="tab-input flex Jbetween " style="width: 100%;padding-top: 10rpx;"></view>
							<view class="text24 fontWeight " style="color:#000000;margin: 20rpx;">本部分仅记录出游花费</view>
							<uni-transition :duration="1000" :mode-class="'slide-right'" :show="transShow">
								<view class="" style="">
									<button class="text30  fontWeight" type="default"
										style="width: 100%;margin-top: 10rpx;color: #FFFFFF;"
										@click="urlHomeIndex">去记账</button>
								</view>
							</uni-transition>
						</view>
					</view>
				</view>
			</uni-transition>
			<!-- 法人只有一次性记账 -->
			<view class="" v-if="user_type==='法人'">
				<uni-transition :duration="1000" :mode-class="'zoom-out'" :show="transShow">
					<!-- background: url(../../static/image-min.png) no-repeat;background-size: cover;  -->
					<view class="tab-content"
						style="width:710rpx;padding-right: 20rpx;padding-left: 20rpx;border-bottom-right-radius: 15rpx;border-bottom-left-radius: 15rpx;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;">
						<calendar :list="monthListData" :nowMonth="month" @monthChangeItem="monthChangeItem"
							@monthImgChange="monthImgChange" :year="year" :isBig="isBig"></calendar>
					</view>
				</uni-transition>
			</view>
		</view>
		<view v-if="user_type=='自然人' || user_type=='法人' || user_type=='联络人'">
			<uni-transition :duration="1000" :mode-class="'slide-left'" :show="transShow">
				<view class="swiper-back ">
					<swiper class="swiper-box" :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular"
						:interval="interval" :duration="duration" indicator-active-color="#5f5f5f"
						indicator-color="#b6b6b6">
						<!-- style="border-radius: 15rpx;" -->
						<swiper-item v-for="(item,i) in swiperListData" :key="i">
							<image class="image" :src="item.image" mode="aspectFill" @click="swiperClick(item)" />
						</swiper-item>
					</swiper>
				</view>
			</uni-transition>
		</view>

		<!-- :style="{marginTop:user_type=='联络人'?'0rpx':'150rpx'}" -->
		<view class="flex Jbetween Acenter">
			<view class="flex Acenter" style="margin-left: 20rpx;">
				<image style="height: 30rpx;width:40rpx" src="../../static/uview/example/history-min.png" mode="">
				</image>
				<text class="fontWeight text34" style="margin-left: 20rpx;">历史记录</text>
			</view>
		</view>
		<view v-if=" tabIndex==1 && billListData.length==0"
			style="color: #999999; font-size: 28rpx;text-align: center;margin: 100rpx auto;">暂无记账列表</view>
		<!-- 实时记账记账列表-->
		<uni-transition :duration="800" :mode-class="'slide-bottom'" :show="transShow">
			<view class="content" v-if="tabIndex==0 && realListData.length" v-for="(item, index) in realListData"
				:key="index">
				<!-- <image src="../../static/jiudian.png" mode=""></image> -->
				<view class="item " style="flex-direction:column;">
					<view style="margin-bottom: 20rpx;">{{item.month}} 月</view>
					<view class="flex Jbetween Acenter">
						<view class="flex flex-align-center">
							<view class="bill-img flex  Acenter Jcenter">
								<image :src="onImgChange(item.onImg)"></image>
							</view>
							<view style="margin-left: 20rpx;margin-right: 100rpx;">
								<view class=" c999 f24" style="margin-bottom: 10rpx;">消费名目:</view>
								<text class="text28 fontWeight">{{item.useName}}</text>
							</view>
							<view class="flex-1" style="margin-left: 20rpx;">
								<text class="c999 f24" style="margin-bottom: 10rpx;">填写人:</text>
								<text class="title text28">{{item.name}}</text>
							</view>
						</view>
						<text class="money f34">¥{{item.operating}}</text>
					</view>
				</view>
			</view>
		</uni-transition>
		<!-- 一次性记账列表-->
		<uni-transition :duration="800" :mode-class="'slide-bottom'" :show="transShow">
			<view class="content" v-if="tabIndex==1 || user_type=='法人'" v-for="(item, index) in billListData"
				:key="index" @click="urlDetailHome(item)">
				<!--  -->
				<view class="item">
					<view class=" flex flex-pack-justify flex-align-center">
						<view class="flex flex-align-center">
							<view class="flex-1" style="margin-left:20rpx">
								<text class="title f30">{{ user_type=='自然人'?item.month+'月支出':item.month+'月收入'}}</text>
								<text class="c999 f24"
									style="margin-top: 20rpx; margin-bottom: 20rpx;">{{ item.name }}</text>
								<text class="c999 f24">{{ item.createtime || '暂无时间' }}</text>
							</view>
						</view>
						<text class="money f34">¥{{ item.operating  || 0}}</text>
					</view>
					<uni-transition :duration="800" :mode-class="'slide-bottom'" :show="transShow">
						<view class="flex Jbetween" style="padding-left: 20rpx;margin-top: 30rpx;">
							<view class="">
								<text v-if="item.adopt_id==3" class="success"
									style="font-size: 25rpx;font-weight: bold;">当前状态 : 已通过</text>
								<text v-if="item.adopt_id==4" class="warning"
									style="font-size: 25rpx;font-weight: bold;">当前状态 : 初审通过</text>
								<text v-if="item.adopt_id==1" class="warning"
									style="font-size: 25rpx;font-weight: bold;">当前状态 : 待审批</text>
								<text v-if="item.adopt_id==2" class="error"
									style="font-size: 25rpx;font-weight: bold;">当前状态 : 未通过</text>
							</view>
							<u-button v-if="item.adopt_id==2" type="error" size="mini" @click="resetSubmit(item)">重新提交
							</u-button>
						</view>
					</uni-transition>
				</view>
			</view>
		</uni-transition>
		<!-- 弹框提示 -->

		<u-popup border-radius="10" v-model="isPopup" @close="close" :mode="mode" length="90%" :mask="mask"
			:closeable="closeable" :close-icon-pos="closeIconPos" borderRadius="20">
			<view class="" style="padding-top: 40rpx;">
				<view style="height: 270rpx;">
					<view class="text-center text30 textColor fontWeight " style="margin-bottom: 40rpx;">温馨提示</view>
					<view class=" fontColor28 fontWeight text-center" style="margin-bottom: 30rpx;">需要选择旅行开始时间以及结束时间
					</view>
					<view class="text-center" style="margin-bottom: 35rpx;">您本次出游总共花费</view>
					<view class="text-center">3000</view>
				</view>
				<view class="flex ">
					<button style="flex:1;border: none;" class="text30 " @click="isPopup = false;">取消</button>
					<button style="flex:1 ;border: none;" class="text30 textColor" @click="isPopup = false;">确认</button>
				</view>
			</view>
		</u-popup>
		<!-- 底部操作栏 -->
		<u-tabbar v-model="current" :show="vuex_show" :bg-color="vuex_bgColor" :border-top="vuex_borderTop"
			:list="vuex_tabbar" :mid-button="vuex_midButton" :hide_tab_bar="vuex_hide_tab_bar"
			:inactive-color="vuex_inactiveColor" :activeColor="vuex_activeColor " @change="tabbarChange()"></u-tabbar>
		<!-- 暂时不要删除下面导航栏 -->
		<!-- <u-tabbar :list="vuex_tabbar" :mid-button="true"  @change="change"></u-tabbar> -->
		<!-- 底部弹窗 -->
		<!-- 日期选择器 -->
		<mx-date-picker :show="showPicker" :type="type" :value="pickerData" :show-tips="true" :begin-text="'开始'"
			:end-text="'结束'" :show-seconds="false" @confirm="pickerConfirm" @cancel="pickerCancle" />
		<!-- 实时记账参团非参团弹窗内容 -->

		<!-- 是否弹出生日贺卡弹出层 -->
		<u-popup v-if="form.isShow" @close="isBoirthdayChange" width="85%" v-model="form.isShow" mode="center"
			length="95%" bgColor="transparent">
			<view style="height: 600rpx;">
				<img style="width: 100%; height: 100%;" v-if="isBorithdayPicture" :src="isBorithdayPicture" alt="">
			</view>
		</u-popup>
		<!-- 是否弹出年报推送的弹出层 -->
		<u-popup v-if="form.isYearBao" @close="isYearBaoChange" width="85%" v-model="form.isYearBao" mode="center"
			length="95%" bgColor="transparent">
			<view style="height: 600rpx;" @click="isYearBaoClick">
				<img style="width: 100%; height: 100%;" :src="reportImageData.cover_img" alt="">
			</view>
		</u-popup>
		<view style="margin-top: -60rpx;">
			<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText"
				:nomore-text="nomoreText" />
		</view>
	</view>
</template>

<script>
	const app = getApp() //获取公共参数
	import calendar from '@/components/calendar/calendar.vue'
	import util from '../../utils/util.js'
	import MxDatePicker from './mx-datepicker/mx-datepicker.vue'
	export default {
		components: {
			MxDatePicker,
			calendar
		},
		data() {
			return {
				reportImageData: "", //年报图片
				textShow: false,
				statusShow: false,
				transShow: false,
				monthListData: [{
					back: "",
					name: 1,
					isShow: false //是否有记账   显示记账对勾图标
				}, {
					back: "",
					name: 2,
					isShow: false
				}, {
					back: "",
					name: 3,
					isShow: false
				}, {
					back: "",
					name: 4,
					isShow: false
				}, {
					back: "",
					name: 5,
					isShow: false
				}, {
					back: "",
					name: 6,
					isShow: false
				}, {
					back: "",
					name: 7,
					isShow: false
				}, {
					back: "",
					name: 8,
					isShow: false
				}, {
					back: "",
					name: 9,
					isShow: false
				}, {
					back: "",
					name: 10,
					isShow: false
				}, {
					back: "",
					name: 11,
					isShow: false
				}, {
					back: "",
					name: 12,
					isShow: false
				}, ],
				// 审核状态
				isStatus: 2,
				isBig: true,
				isMessage: true, //是否有新消息
				isLogout: null, //判断小程序是否退出了程序
				status: 'nomore',
				loadingText: '努力加载中',
				loadmoreText: '轻轻上拉',
				nomoreText: '实在没有了',
				isBoirthdayStatus: false, //是否显示生日贺卡
				isBorithdayPicture: "", //生日贺卡图片
				form: {
					isShow: false, //是否弹出生日贺卡图片
					isYearBao: false //是否弹出年报推送弹窗
				},
				showPicker: false, //是否显示日期
				type: 'rangetime', //日期范围模式
				pickerData: '请选择时间范围', //最终选择的日期时间
				// 赋值的日期范围
				rangetime: [],
				totalMoney: 0, //本次出游总花费
				isPopup: false, //是否弹出层
				imgHost: this.$imgHost, //图片公用地址
				show: false, //是否显示底部签署合同弹窗
				mode: 'center',
				mask: true, // 是否显示遮罩
				closeable: true,
				closeIconPos: 'top-right',
				currentIndex: 0,
				tabListData: [
					'实时记账',
					'按次记账'
				],
				tabListDataTwo: [
					'按次记账'
				],
				tabIndex: 0, //0 实时记账 1  按次记账
				current: 0,
				dataIndex: false,
				//轮播图配置
				indicatorDots: true, //是否显示指示点
				circular: true, //是否采用衔接滑动
				autoplay: true, //是否自动华东
				interval: 2000, //切换的间隔时间
				duration: 500, //滑动动画时长
				currentAddress: '定位中...',
				loading: true,
				// 记账列表数据
				billListData: [],
				// 实时记账列表数据
				realListData: [],
				// 轮播图数据配置
				swiperListData: [],
				// 是否弹出广告弹窗
				isShowAdvertisement: null,
				// 用户信息
				userInfo: null,
				hasUserInfo: false,
				// canIUse: uni.canIUse('button.open-type.getUserInfo'),
				lists: [],
				islists: false,
				page: 1,
				count: 0,
				id: '',
				user_type: '', //用户身份
				type_id: '', //具体业务类型
				code: '', //【判断当月是否存在记账记录
				year: '', //当前年份
				month: '', //当前月份
				business_specific_type: 15, //法人记账指标类型  1 旅行社记账  2  景区记账  3  酒店记账  4  新业态记账  5  乡村民宿记账  6 乡村农家乐记账  7  乡村餐馆记账
				selected: 0,
				openid: '', //用户openid
				page: 1, //页码
				province: null, //自然人省
				urban_district: null, //自然人市
				county: null, //自然人区
				address_county: null, //法人区
				address_district: null, //法人市
				address_province: '', //法人省
				bookkeeping: 0, // 自然人法人条件下是否开启记账功能//只有自然人会有是否记账功能  法人联络人都没有
				business_type: "",
				yearMonthData: []
			};
		},
		/*下拉刷新*/
		onPullDownRefresh: function() {
			this.page = 1
			let userInfo = uni.getStorageSync('userInfo');
			let openid = uni.getStorageSync('openid')
			if (userInfo) {
				this.userInfo = userInfo
				this.bookkeeping = this.userInfo[0].bookkeeping ? this.userInfo[0].bookkeeping : "是" //自然人条件下是否有记账
				this.id = userInfo[0].id,
					this.user_type = userInfo.user_type
			}
			if (userInfo.user_type == "自然人") {
				this.reportListData() //获取上一年年报
			}
			if (userInfo.user_type == "法人") {
				this.type_id = userInfo[0].business_specific_type
				this.business_specific_type = userInfo ? userInfo[0].business_specific_type : ""
				this.business_type = userInfo ? userInfo[0].business_type : ""
				let parmas = {
					address_province: userInfo ? userInfo[0].address_province : "", //法人省
					address_district: userInfo ? userInfo[0].address_district : "", //法人市
					address_county: userInfo ? userInfo[0].address_county : "" //法人区
				}
				let data = {
					uid: this.id,
					user_type: this.user_type,
					type_id: this.type_id
				}
				this.getBillListData(data) // 获取记账列表
				this.getSerListData(parmas); // 获取轮播图问卷列联表
				// 获取法人每月记账情况
				this.getYearMonthListData()

			} else {
				let params = {
					province: userInfo[0].province,
					urban_district: userInfo[0].urban_district,
					county: userInfo[0].county
				}
				let data = {
					uid: this.id,
					user_type: this.user_type
				}
				this.getSerListData(params); // 获取轮播图问卷列联表
				this.getBillListData(data) // 获取记账列表
			}


			// 赋值openid
			this.openid = openid
			setTimeout(() => {
				//关闭下拉刷新
				uni.stopPullDownRefresh()
			}, 1000)


			console.log('下拉刷新是否显示', this.user_type)
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			// 强制刷新


			this.transShow = true
			this.textShow = true
			var myDate = new Date(); //获取系统当前时间
			this.year = myDate.getFullYear()
			let month = myDate.getMonth() + 1
			this.monthListData.forEach(item => {
				if (item.name > month) {
					console.log('onShowonShowonShowonShow', item.name)
					item.back = 0.2
				} else {
					item.back = ""
				}
			})
			uni.setStorageSync('tabIndex', 0)
			let userInfo = uni.getStorageSync('userInfo');
			let isShowAdvertisement = uni.getStorageSync('openid');
			var openid = uni.getStorageSync('openid')
			// 赋值openid
			this.openid = openid
			this.getStorageListData()
			this.getTotalMoney()
			// 重新重置底部导航栏选中背景颜色
			if (this.dataIndex == true) { //此操作是为了如果点击了中间的图标跳转页面后。再次返回时候，图标选中状态会没有。所以判断当前是否点击了中间图标。依次来再次初始化中间图标的选中状态
				this.current = 1
			} else {
				this.current = 0
			}
			// 获取用户信息
			var phone = uni.getStorageSync('phone')

			if (!phone) {
				// 如果不存在手机  执行授权
				uni.navigateTo({
					url: '../componentsB/image/index'
				})
			} else {
				console.log('获取当前onshow的当前年份和月份获取当前onshow的当前年份和月份获取当前onshow的当前年份和月份', this.year, month, this.$store
					.state.vuex_isBirthday)

				console.log('这次获取vuex中的状态', this.isBoirthdayStatus)


				// 如果存在手机  直接登录
				let userInfo = uni.getStorageSync('userInfo');
				if (userInfo) {
					this.userInfo = userInfo,
						this.id = userInfo ? userInfo[0].id : '',
						this.bookkeeping = this.userInfo[0].bookkeeping ? this.userInfo[0].bookkeeping :
						0 //自然人条件下是否有记账
					this.business_specific_type = userInfo ? userInfo[0].business_specific_type : ""
					this.user_type = userInfo ? userInfo.user_type : "" //暂时不要删除
				}
				if (userInfo.user_type == "自然人") {
					console.log('这里是判断', this.form.isShow, this.$store.state.vuex_isBirthday)

					// 获取是否存在生日贺卡信息
					this.getBirthdayData(userInfo[0].id)
					this.reportListData() //获取上一年年报
				}
				if (userInfo.user_type == "法人") {
					console.log('走缓存法人')
					this.bookkeeping = "是"
					this.type_id = userInfo[0].business_specific_type
					this.business_type = userInfo[0].business_type
					var params = {
						address_province: userInfo[0].address_province, //法人省
						address_district: userInfo[0].address_district, //法人市
						address_county: userInfo[0].address_county //法人区
					}
					let data = {
						uid: this.id,
						user_type: this.user_type,
						type_id: this.type_id
					}
					this.getBillListData(data) // 获取记账列表
					this.getSerListData(params); // 获取轮播图问卷列联表
					// 获取法人每月记账情况
					this.getYearMonthListData()
				} else {
					console.log('走缓存自然人')
					var params = {
						province: userInfo[0].province ? userInfo[0].province : "",
						urban_district: userInfo[0].urban_district ? userInfo[0].urban_district : "",
						county: userInfo[0].county ? userInfo[0].county : ""
					}
					let data = {
						uid: this.id,
						user_type: this.user_type,
					}
					this.getBillListData(data) // 获取记账列表
					this.getSerListData(params); // 获取轮播图问卷列联表
				}
				this.userInfo = userInfo

				// 判断是否有新消息
				this.isMessageData()
			}
			uni.showToast({
				title: '加载中...',
				icon: 'loading',
				duration: 1000
			});
			var type = ""
			if (this.user_type === "自然人") {
				// 如果身份是自然人  判断是否存在生日贺卡。。
				type = 1
			} else {
				type = 2
			}

			let isLogout = uni.getStorageSync('isLogout')
			if (isLogout) {
				this.loginScore(type, this.id) //先调用一次积分累计  再移除缓存
				uni.removeStorageSync('isLogout') //删除是否退出小程序缓存。下次进入小程序再次存储判断

			}
			// 判断当前年份   每年只显示一次生日贺卡图片
			// this.getSerListData(params)

		},
		onLoad: function() {
			this.$forceUpdate()
			this.transShow = true
			this.textShow = true
			uni.setStorageSync('tabIndex', 0)
			// 如果存在手机  直接登录
			let userInfo = uni.getStorageSync('userInfo');
			let id = ""
			if (userInfo) {
				this.business_type = userInfo[0].business_type
				id = userInfo[0].id
			}

			if (userInfo.user_type === "自然人") {
				var type = 1
			} else {
				var type = 2
			}

			this.loginScore(type, id) //每次进入小程序都要调用一次
			this.totalMoney = 0
			this.status = 'loading'
			var myDate = new Date(); //获取系统当前时间
			this.year = myDate.getFullYear()
			console.log('onload鱼粉与粉嫩刚发', this.year)
			this.month = myDate.getMonth() + 1
			console.log('获取比较获取比较获取比较', this.month, this.monthListData)
			this.monthListData.forEach(item => {
				if (item.name > this.month) {
					console.log('name', item.name)
					item.back = 0.2
				} else {
					item.back = ""
				}
			})
			console.log('赋值后的数组0', this.monthListData)
			this.getStorageListData()
			this.getTotalMoney()
			this.current = 0
			// this.getSerListData(); // 获取轮播图问卷列联表


		},
		onHide: function() {
			console.log('页面隐藏1', this.transShow);
			this.transShow = false
			this.textShow = false
			console.log('页面隐藏2', this.transShow);
			this.isLogout = 1 //小城许退出。设置为true
		},
		methods: {
			// 获取年报封面图
			reportListData: function() {
				var API = this.$store.state.vue_XAPI
				var that = this
				uni.request({
					method: 'POST',
					url: 'https://jizhang.xqyu.cn/index.php/addons/ykquest/survey_api/report_list',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						user_id: that.id
					},
					success: function(res) {
						console.log('res', res.data.data)
						if (res.data.code == 1) {
							if (res.data.data == null) {
								that.form.isYearBao = false //年报内容

							} else {
								res.data.data[0].cover_img = API + res.data.data[0].cover_img
								that.reportImageData = res.data.data[0]
								that.form.isYearBao = true //弹窗年报内容
							}

						} else {
							that.form.isYearBao = false //年报内容
							that.reportImageData = ""
						}
					}
				});
			},
			// 获取法人每月记账情况
			getYearMonthListData: function() {
				var that = this
				uni.request({
					method: 'POST',
					url: 'https://81.70.54.149/index.php/api/legal/get_year_month',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						uid: that.id,
						type: that.business_type
					},
					success: function(res) {

						if (res.data.code == 1) {
							that.yearMonthData = res.data.data
							console.log(
								'获取法人是否记账了resresresresresresresresresresresresresresresresresresresresresresres',
								that.yearMonthData)
							that.monthListData.forEach(item => {
								res.data.data.forEach(item1 => {
									if (item.name == item1.month) {
										item.isShow = true
										item.back = item1.year
									}
								})
							})

						}
					},
				})
			},
			// 生日贺卡弹窗关闭事件
			isBoirthdayChange: function() {
				this.form.isShow = false //关闭生日贺卡弹窗
				this.$store.commit('VUEX_ISBIRTHDAY', true)
			},
			// 年报推送弹窗关闭时间
			isYearBaoChange: function() {
				this.form.isYearBao = false
			},

			// 年报推送点击事件
			isYearBaoClick: function() {
				console.log('跳转', this.reportImageData)
				uni.navigateTo({
					url: "../componentsB/year/index?detailId=" + this.reportImageData.id
				})
			},
			// 获取是否存在生日贺卡信息
			getBirthdayData: function(id) {
				var _self = this
				uni.request({
					method: 'POST',
					url: 'https://jizhang.xqyu.cn/index.php/api/index/birthday',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						user_id: id
					},
					success: function(res) {
						console.log('是否存在生日贺卡信息是否存在生日贺卡信息是否存在生日贺卡信息', res)
						console.log('事实上四十四是死是活', _self.$store.state.vuex_isBirthday)
						if (res.data.code == 1) {
							console.log('_self.$store.state.vuex_isBirthday', _self.$store.state
								.vuex_isBirthday)
							if (_self.$store.state.vuex_isBirthday) {
								//如果vuex_isBirthday为真的话，说明已经弹出过生日贺卡图片了。需要重置弹出生日贺卡图片状态
								// 关闭生日贺卡弹窗
								_self.form.isShow = false

							} else {
								// 弹出生日贺卡图片
								_self.form.isShow = true
								//说明有生日贺卡图片数据
								_self.isBorithdayPicture = res.data.data[0].birthday_images

							}
							_self.$store.commit('VUEX_ISBIRTHDAY', true)
						} else {
							//关闭生日贺卡图片
							_self.form.isShow = false
							// 重置生日贺卡状态  
							_self.$store.commit('VUEX_ISBIRTHDAY', true)
						}
						console.log('生日贺卡状态', _self.$store.state.vuex_isBirthday, )
					}
				});
			},
			messageChange: function() {
				let nowTimestamp = Math.floor((+new Date()) / 1000);
				// 每次点击存储当前时间
				uni.setStorageSync('isMessage', nowTimestamp)
				console.log('存储的值是', uni.getStorageSync('isMessage'))
			},
			// 判断是否有新消息
			isMessageData: function() {
				var _self = this
				var name = this.userInfo ? this.userInfo[0].name : ""
				uni.request({
					method: 'POST',
					url: 'https://jizhang.xqyu.cn/index.php/api/index/new_news',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						name: name
					},
					success: function(res) {
						console.log('结果', res)
						if (res.data.code == 1) {
							let nowTimestamp = Math.floor((+new Date()) / 1000); //当前时间
							console.log('获取到是否有嘻嘻消息细小撤销', res.data.data.createtime)
							let storageIsMessage = uni.getStorageSync('isMessage') ? uni.getStorageSync(
								'isMessage') : 0
							console.log('缓存获取的是否有消息', storageIsMessage)
							if (storageIsMessage < res.data.data.createtime) {
								console.log('有新消息', storageIsMessage, res.data.data.createtime)
								//如果当前时间大于接口返回时间说明当前没有新消息。。否则有新消息
								_self.isMessage = true
							} else {
								console.log('没有新消息', storageIsMessage, res.data.data.createtime)
								_self.isMessage = false
							}
						} else {
							_self.isMessage = false
							_self.$.toast(res.data.msg)
						}
					}
				});
			},
			// 记账列表重新提交
			// 重新提交
			resetSubmit: function(item) {
				console.log('重新提交', item)
				if (this.user_type === "自然人") {
					uni.navigateTo({
						url: "../componentsA/parse/index?item=" + JSON.stringify(item)
					})
				} else {
					console.log('首页法人跳转记账首页法人跳转记账首页法人跳转记账首页法人跳转记账', item)
					this.$set(item, 'clickType', 'new') //用来判断从哪进去的记账页
					if (this.business_specific_type == 1 || this.business_specific_type == 2 || this
						.business_specific_type == 3) {
						uni.navigateTo({
							url: "../template/hotel/index?item=" + JSON.stringify(item)
						}) //酒店记账跳转
					} else if (this.business_specific_type == 4 || this.business_specific_type == 5 || this
						.business_specific_type == 6) { //景区记账
						uni.navigateTo({
							url: "../template/parkLand/index?item=" + JSON.stringify(item)
						})
					} else if (this.business_specific_type == 7 || this.business_specific_type == 8) {
						uni.navigateTo({
							url: "../template/travel/index?item=" + JSON.stringify(item)
						}) //旅行社记账跳转
					} else if (this.business_specific_type == 9 || this.business_specific_type == 10 || this
						.business_specific_type == 11 || this.business_specific_type == 12) {
						uni.navigateTo({
							url: "../library/debounce/index?item=" + JSON.stringify(item)
						}) //新业态记账
					} else if (this.business_specific_type == 13) { //民宿记账
						uni.navigateTo({
							url: "../library/deepClone/index?item=" + JSON.stringify(item)
						})
					} else if (this.business_specific_type == 14) { //农家乐记账
						uni.navigateTo({
							url: "../template/countrySmile/countrySmile?item=" + JSON.stringify(item)
						})
					} else if (this.business_specific_type == 15) { //餐饮记账
						uni.navigateTo({
							url: "../template/country/index?item=" + JSON.stringify(item)
						})
					}
				}

			},
			// 法人年份点击事件
			monthImgChange: function(obj) {
				console.log('this.istext', this.isText, obj)
				let myDate = new Date(); //获取系统当前时间
				let year = myDate.getFullYear()
				if (obj.item == 1) { //点击的是左边
					let newYear = this.year
					newYear = newYear - 1
					console.log('this.year', this.year)
					console.log('newYear', newYear)
					if (newYear < year) {
						this.isBig = false
					} else {
						this.isBig = true
					}
					this.year = this.year - 1
					console.log('点击的是左边', obj, this.year)
				} else {
					let newYear = this.year
					newYear = newYear + 1
					console.log('加了', newYear, year)
					console.log('点击的是右边', obj, newYear)
					if (year > newYear) {
						this.year = this.year + 1
						return
					} else if (newYear == year) {
						this.isBig = true
						this.year = year

					} else if (newYear > year) {
						this.isBig = true
						this.$.toast('已经到头了')
					}
				}
			},
			// 法人日历月份点击事件
			monthChangeItem: function(item) {
				console.log('获取子组件传递过来的月份', item, this.month)
				let myDate = new Date(); //获取系统当前时间
				let month = myDate.getMonth() + 1
				if (item > month) {
					this.$.toast('不支持之后月份记账')
					return
				}
				this.month = item
				var obj = {
					month: item,
					year: this.year,
					id: this.id,
					clickType: 'month'
				}
				if (this.business_type == 1 || this.business_type == 2 || this.business_type == 3 || this
					.business_type == 4 || this.business_type == 5) {
					// 传递对应月份
					if (this.business_specific_type == 1 || this.business_specific_type == 2 || this
						.business_specific_type == 3) {
						uni.navigateTo({
							url: "../template/hotel/index?item=" + JSON.stringify(obj)
						}) //酒店记账跳转
					} else if (this.business_specific_type == 4 || this.business_specific_type == 5 || this
						.business_specific_type == 6) { //景区记账
						uni.navigateTo({
							url: "../template/parkLand/index?item=" + JSON.stringify(obj)
						})
					} else if (this.business_specific_type == 7 || this.business_specific_type == 8) {
						uni.navigateTo({
							url: "../template/travel/index?item=" + JSON.stringify(obj)
						}) //旅行社记账跳转
					} else if (this.business_specific_type == 9 || this.business_specific_type == 10 || this
						.business_specific_type == 11 || this.business_specific_type == 12) {
						uni.navigateTo({
							url: "../library/debounce/index?item=" + JSON.stringify(obj)
						})
					} else if (this.business_specific_type == 13) {
						uni.navigateTo({
							url: "../library/deepClone/index?item=" + JSON.stringify(obj)
						})
					} else if (this.business_specific_type == 14) {
						uni.navigateTo({
							url: "../template/countrySmile/countrySmile?item=" + JSON.stringify(obj)
						})
					} else if (this.business_specific_type == 15) {
						uni.navigateTo({
							url: "../template/country/index?item=" + JSON.stringify(obj)
						})
					}
				} else {
					this.$.toast('未开通记账功能')
				}
			},
			// 每次进入小程序都调用一次登录累计积分
			loginScore: function(type, id) {
				var that = this
				uni.request({
					method: 'POST',
					url: 'https://jizhang.xqyu.cn/index.php/api/index/login_score',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						type: type,
						id: id
					},
					success: function(res) {
						if (res.data.code == 1) {
							// that.score_num =res.data.data[0].score_sum
						} else {

						}
					},
					fail: function(err) {

					}
				});
			},
			// 自然人去提交按钮事件
			urlSubmitButton: function() {
				// this.$.toast('记账功能暂未开启，敬请期待')
				// return
				uni.navigateTo({ //去实时记账页面
					url: '../library/home/index'
				})
			},
			// 自然人一次性记账
			urlHomeIndex: function() {
				// this.$.toast('记账功能暂未开启，敬请期待')
				// return
				if (this.user_type === "法人") {
					if (this.business_type == 1 || this.business_type == 2 || this.business_type == 3 || this
						.business_type == 4 || this.business_type == 5) {
						if (this.type_id == 1 || this.type_id == 2 || this.type_id == 3) {
							uni.navigateTo({
								url: "../template/hotel/index"
							}) //酒店记账跳转
						} else if (this.type_id == 4 || this.type_id == 5 || this.type_id == 6) { //景区记账
							uni.navigateTo({
								url: "../template/parkLand/index"
							})
						} else if (this.type_id == 7 || this.type_id == 8) {
							uni.navigateTo({
								url: "../template/travel/index"
							}) //旅行社记账跳转
						} else if (this.type_id == 9 || this.type_id == 10 || this.type_id == 11 || this.type_id ==
							12) { //新业态
							uni.navigateTo({
								url: "../library/debounce/index"
							})
						} else if (this.type_id == 13) { //民宿
							uni.navigateTo({
								url: "../library/deepClone/index"
							})
						} else if (this.type_id == 14) { //农家乐
							uni.navigateTo({
								url: "../template/countrySmile/countrySmile"
							})
						} else if (this.type_id == 15) { //餐饮
							uni.navigateTo({
								url: "../template/country/index"
							})
						}
					} else {
						this.$.toast('未开启记账功能')
						return
					}
				} else {
					if (this.user_type == '自然人') {
						var user_type = 1
					} else {
						var user_type = 2
					}
					let obj = {
						type: "一次性记账",
						user_type: user_type,
						id: this.id
					}
					uni.navigateTo({
						url: '../componentsA/parse/index?item=' + JSON.stringify(obj) //跳转自然人一次性记账页
					})
				}
			},
			// 列表图标格式化函数
			onImgChange: function(data) {
				var url = ""
				if (data) {
					url = data.replace("../../../", "../../")
				}
				return url
			},
			// getListData:function(){
			//           console.log('获取存储缓存之前的lists',this.lists)
			// 	let listData=uni.setStorageSync('listData',this.lists)
			// 	console.log('这里该赋值了',listData)
			// },
			getStorageListData: function() {
				let listData = uni.getStorageSync('listData') || []
				this.realListData = listData
				if (this.realListData.length == 0) {
					this.status = 'nomore'
				}
			},
			getTotalMoney: function() {
				this.totalMoney = 0 //初始化
				var totalMoney = 0
				if (this.realListData.length) {
					let realListData = this.realListData
					realListData.forEach(item => {
						totalMoney += item.operating
					})

					this.totalMoney = totalMoney.toFixed(2)
				}
			},
			// 弹出层收起
			close: function() {
				this.isPopup = false
			},
			// 实时记账，按次记账tab切换
			tabbarIndexChange: function(index) {
				this.tabIndex = index
				console.log('点击的是', index)
				uni.setStorageSync('tabIndex', index)
				if (this.user_type == '法人') {

					let data = {
						uid: this.id,
						user_type: this.user_type,
						type_id: this.type_id
					}
					if (index == 1) { //如果点击的是按次记账tab 重新调用获取账单列表
						this.getBillListData(data) //重新调用获取账单列表
						this.statusShow = true

					} else {
						this.statusShow = false

					}
				} else {
					let data = {
						uid: this.id,
						user_type: this.user_type,
					}
					if (index == 1) { //如果点击的是按次记账tab 重新调用获取账单列表
						this.getBillListData(data) //重新调用获取账单列表
						this.statusShow = true

					} else {
						this.statusShow = false

					}
				}

			},
			// 日期选择器取消
			pickerCancle: function(e) { //选择
				this.showPicker = false
			},
			// 日期确定
			pickerConfirm: function(e) {
				if (e) { //日期格式化
					let time = e.value
					this.rangetime = time
					let arr1 = this.rangetime[0].replace('00:00', '')
					let arr2 = this.rangetime[1].replace('00:00', '')
					let arr3 = arr1 + ' ' + '至' + ' ' + arr2
					let rangetime = arr3.split('至')
					this.rangetime = rangetime
					// let rangetime=arr3.split('--------')
					let newTime = this.rangetime[0]
					let newTime1 = this.rangetime[1]
					this.showPicker = false
					this.submitButtonQuest(newTime, newTime1) //调取数据函数发送请求

				}
			},
			// 实时记账请求函数
			submitButtonQuest: function(newTime, newTime1) {
				this.lists.length = 0 //要清空下push的数组。否则会拼接之前记账过的数据
				this.lists = [] //要清空下push的数组。否则会拼接之前记账过的数据
				var that = this
				var type = ''
				if (this.user_type === "法人") { //法人2
					type = 2
				} else if (this.user_type === "联络人") { //联络人3
					type = 3
				} else { //自然人1

					type = 1
				}
				var listData = uni.getStorageSync('listData') || [] //移除缓存中获取的记账列表数据
				var params = {
					time: newTime + '-' + newTime, //待修改
					month: listData[0].month, //月份
					uid: this.id, //用户id
					flag: type, //用户类型
					type_id: listData[0].tabbarIndex, //记账的时候选择的是参团还是非参团
					year: this.year, //年费
				}
				var that = this
				if (listData[0].tabbarIndex == 1) { //选择的是参团记账
					let gouwuTotal = 0
					let qitaTotal = 0
					listData.forEach(item => {
						if (item.gouwu === '购物') {
							gouwuTotal += item.operating
						}

						if (item.qita === '其他购物') {
							qitaTotal += item.operating
						}
						params.other_price = qitaTotal //参团其他花费总数赋值
						params.shop_total = gouwuTotal //参团购物花费总数赋值

						if (item.useName === "文创产品") {
							params.cultural = item.operating
						} else if (item.useName === "农林牧渔产品") {
							params.agriculture = item.operating
						} else if (item.useName === "特产") {
							params.specialty = item.operating
						} else {
							params.other = item.operating
						}
					})
					params.above_price = this.totalMoney //总消费   会在记账列表里显示出来
					uni.showModal({
						title: '提示',
						content: '确认一键提交吗?',
						success: function(res) {
							if (res.confirm) {
								let url = 'https://jizhang.xqyu.cn/index.php/api/natural/get_gation'
								uni.removeStorageSync('listData') // 清空缓存记账信息
								that.submitButtonRequest(params, url) //调用记账提交请求
								that.totalMoney = 0 //清空总花费
								that.realListData = [] //清空记账列表
							} else if (res.cancel) {}
						}
					});
				} else {
					let trans = '' //交通花费
					let jiaotongTotal = 0
					let zhusuTotal = 0
					let gouwuTotal = 0
					let youlanTotal = 0
					let xiuxianTotal = 0
					let qitaTotal = 0

					listData.forEach(item => {
						// 分类总数合计
						if (item.jiaotong === '交通') {
							jiaotongTotal += item.operating
						} else if (item.zhusu === '住宿') {
							zhusuTotal += item.operating
						} else if (item.gouwu === '购物') {
							gouwuTotal += item.operating
						} else if (item.youlan === '游览') {
							youlanTotal += item.operating
						} else if (item.xiuxian === '休闲') {
							xiuxianTotal += item.operating
						} else
						if (item.qita === '其他交通' || item.qita === '其他住宿' || item.qita === '其他游览' || item
							.qita === '其他购物' || item.qita === '其他休闲') {
							qitaTotal += item.operating
						}
						params.trans = jiaotongTotal //交通花费总数赋值
						params.accomm = zhusuTotal //住宿花费总数赋值
						params.shop_expen = gouwuTotal //购物花费总数赋值
						params.cost = youlanTotal //游览花费总数赋值
						params.leisures = xiuxianTotal //休闲娱乐花费总数赋值
						params.other_tele = qitaTotal //其他花费总数赋值
						if (item.useName === "飞机") {
							params.aircraft = item.operating
						} else if (item.useName === "火车") {
							params.train = item.operating
						} else if (item.useName === "汽车") {
							params.automobile = item.operating
						} else if (item.useName === "出租车") {
							params.taxi = item.operating
						} else if (item.useName === "汽车出租") {
							params.car_rental = item.operating
						} else if (item.useName === "加油费") {
							params.refueling = item.operating
						} else if (item.useName === "停车费") {
							params.parking = item.operating
						} else if (item.useName === "过路费") {
							params.road_toll = item.operating
						} else if (item.useName === "其它交通") {
							params.other = item.operating
						} else if (item.useName === "酒店") {
							params.hotel = item.operating
						} else if (item.useName === "民宿") {
							params.civil = item.operating
						} else if (item.useName === "营地") {
							params.camp = item.operating
						} else if (item.useName === "其它住宿") {
							params.other_dation = item.operating
						} else if (item.useName === "文创产品") {
							params.cultural = item.operating
						} else if (item.useName === "农林牧渔产品") {
							params.banimal = item.operating
						} else if (item.useName === "特产") {
							params.specialty = item.operating
						} else if (item.useName === "其它购物") {
							params.other_shop = item.operating
						} else if (item.useName === "景区门票") {
							params.scenic = item.operating
						} else if (item.useName === "景区游乐") {
							params.amusement = item.operating
						} else if (item.useName === "主题乐园") {
							params.theme = item.operating
						} else if (item.useName === "场馆门票") {
							params.venue = item.operating
						} else if (item.useName === "其他游览") {
							params.other_ven = item.operating
						} else if (item.useName === "电影") {
							params.film = item.operating
						} else if (item.useName === "演唱会") {
							params.vocal_concert = item.operating
						} else if (item.useName === "音乐会") {
							params.music_festival = item.operating
						} else if (item.useName === "其他休闲") {
							params.other_section = item.operating
						}
					})
					params.total_above = this.totalMoney //总消费   会在记账列表里显示出来
					uni.showModal({
						title: '提示',
						content: '确认一键提交吗?',
						success: function(res) {
							if (res.confirm) {
								let url = 'https://jizhang.xqyu.cn/index.php/api/natural/get_nomis'
								uni.removeStorageSync('listData') // 清空缓存记账信息
								that.submitButtonRequest(params, url) //调用记账提交请求
								that.totalMoney = 0 //清空总花费
								that.realListData = [] //清空记账列表
							} else if (res.cancel) {}
						}
					});
				}
			},
			// 实时记账一键提交
			submitButton: function() {
				var listData = uni.getStorageSync('listData') || [] //移除缓存中获取的记账列表数据
				if (listData.length == 0) {
					this.$.toast('您还有添加实时记账，请先添加实时记账后再提交')
				} else {
					console.log('实时记账一键提交了', listData, this.totalMoney)
					let obj = {
						listData: listData,
						totalMoney: this.totalMoney,
						type: "实时记账"
					}
					// // 打开实时记账参团与费参团内容弹窗区域
					// this.form.isShow=true
					uni.navigateTo({ //传递缓存中的实时记账列表内容到一次性记账列表自动赋值..
						url: '../componentsA/parse/index?item=' + JSON.stringify(obj)
					})
					// return
					// this.showPicker = true//打开时间弹窗
				}
			},
			submitButtonRequest: function(params, url) {
				var that = this
				this.$.tipLoading('提交中')
				uni.request({
					method: 'POST',
					url: url,
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: params,
					success: function(res) {
						setTimeout(function() {
							that.$.hideLoading()
						}, 1500)
						if (res.data.code == 1) {
							that.$.successToast(res.data.msg)
						} else {
							that.$.toast(res.data.msg)
						}
					}
				})
			},
			// 底部导航栏切换事件
			tabbarChange(event) {
				this.dataIndex = false
				this.current = 0
				console.log('走哪里了1')
				if (event == 0) {
					uni.switchTab({
						url: './components'
					})
				} else if (event == 1) { //如果点击中间图标  跳转添加记账页 
					console.log('走哪里了2')
					if (this.user_type === "自然人") {
						console.log('走哪里了3', this.bookkeeping)
						if (this.bookkeeping === "是") {
							console.log('可以跳转了')
							if (this.tabIndex == 0) { //点击的是实时记账 点击加号跳转实时记账
								uni.navigateTo({ //跳转自然人记账页面
									url: "../library/home/index"
								})
							} else { //否则跳转一次性记账
								uni.navigateTo({ //跳转自然人记账页面
									url: "../componentsA/parse/index"
								})
							}

						} else {
							// 说明没有几张功能  禁止继续执行  否则向下执行
							this.$.toast('暂未开启记账功能,请联系管理员')
							return
						}
					} else {
						console.log('走哪里了6')
						this.dataIndex = true
						if (this.user_type === '联络人') { //联络人
							uni.navigateTo({
								url: './js' //联络人记账页面
							})
						} else if (this.user_type === '自然人') { //自然人
							if (this.tabIndex == 0) { //点击的是实时记账 点击加号跳转实时记账
								uni.navigateTo({ //跳转自然人记账页面
									url: "../library/home/index"
								})
							} else { //否则跳转一次性记账
								uni.navigateTo({ //跳转自然人记账页面
									url: "../componentsA/parse/index"
								})
							}
						} else { //法人
							console.log('判断busytp类型', this.business_type)
							let obj = {
								clickType: 'add'
							}
							if (this.business_type == 1 || this.business_type == 2 || this.business_type == 3 || this
								.business_type == 4 || this.business_type == 5) {
								if (this.business_specific_type == 1 || this.business_specific_type == 2 || this
									.business_specific_type == 3) {
									uni.navigateTo({
										url: "../template/hotel/index?item=" + JSON.stringify(obj)
									}) //酒店记账跳转
								} else if (this.business_specific_type == 4 || this.business_specific_type == 5 || this
									.business_specific_type == 6) { //景区记账
									uni.navigateTo({
										url: "../template/parkLand/index?item=" + JSON.stringify(obj)
									})
								} else if (this.business_specific_type == 7 || this.business_specific_type == 8) {
									uni.navigateTo({
										url: "../template/travel/index?item=" + JSON.stringify(obj)
									}) //旅行社记账跳转
								} else if (this.business_specific_type == 9 || this.business_specific_type == 10 || this
									.business_specific_type == 11 || this.business_specific_type == 12) {
									uni.navigateTo({
										url: "../library/debounce/index?item=" + JSON.stringify(obj)
									})
								} else if (this.business_specific_type == 13) {
									uni.navigateTo({
										url: "../library/deepClone/index?item=" + JSON.stringify(obj)
									})
								} else if (this.business_specific_type == 14) {
									uni.navigateTo({
										url: "../template/countrySmile/countrySmile?item=" + JSON.stringify(obj)
									})
								} else if (this.business_specific_type == 15) {
									uni.navigateTo({
										url: "../template/country/index?item=" + JSON.stringify(obj)
									})
								}
							} else {
								this.$.toast('未开通记账功能')
							}

						}
					}
				} else { //如果点击我的  跳转我的页 
					uni.switchTab({
						url: './template'
					})
				}
			},
			// 获取轮播图问卷列表数据
			getSerListData(params) {
				var API = this.$store.state.vue_XAPI
				var that = this
				uni.request({
					method: 'POST',
					// url:'https://jizhang.xqyu.cn/index.php/addons/ykquest/survey_api/serList',
					url: API + '/index.php/addons/ykquest/survey_api/serList',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						openid: that.openid,
						page: that.page,
						user_type: that.user_type,
						province: params.address_province ? params.address_province : params.province,
						urban_district: params.address_district ? params.address_district : params.urban_district,
						county: params.address_county ? params.address_county : params.county,
						business_type: that.business_type || ""
					},
					success: function(res) {
						console.log('获取轮播图数据that.swiperListDatathat.swiperListDatathat.swiperListData',
							res)

						if (res.data.code == 1) {
							let url = 'https://jizhang.xqyu.cn'
							let list = res.data.data.list
							// res.data.data.list.forEach((item, index) => { //暂时不要删除。后台有图片后在删除
							// 	image = url + item.image
							// 	item.image = image
							// })
							console.log('获取轮播图数据that.swiperListDatathat.swiperListDatathat.swiperListData',
								typeof(list), list)
							if (typeof(list) === 'object') {
								if (list.length) {
									// 如果结果返回对象格式。转化数组
									let arr = []
									for (let i in list) {
										arr.push(list[i]);
									}

									arr.forEach((item, index) => { //暂时不要删除。后台有图片后在删除

										let image = url + item.image
										item.image = image
									})
									console.log('转化转化转化转化转化转化转化转化转化转化转化转化转化转化转化转化转化转化转化', arr)
									that.swiperListData = res.data.data.list
								} else {
									let swiperListData = []
									swiperListData[0] = list
									that.swiperListData = swiperListData
								}

							} else {
								if (list[0].image) {
									list.forEach((item, index) => { //暂时不要删除。后台有图片后在删除

										let image = url + item.image
										item.image = image
									})
								} else {
									let swiperListData = []
									swiperListData[0] = list
									that.swiperListData = swiperListData
								}
							}
							// if (list.length) {
							// 	let url = 'https://jizhang.xqyu.cn'
							// 	let image = ""
							// 	list.forEach((item, index) => { //暂时不要删除。后台有图片后在删除  
							// 		image = url + item.image
							// 		item.image = image
							// 	})
							// 	res.data.data.list = list
							// 	that.swiperListData = res.data.data.list

							// } else {
							// 	let swiperListData = []
							// 	swiperListData[0] = res.data.data.list
							// 	that.swiperListData = swiperListData
							// }
						}
					}
				});
			},
			// 轮播图切换事件
			swiperChange: function(e) {
				this.currentIndex = e.detail.current
			},
			// 轮播图点击事件
			swiperClick: function(item) {
				console.log('item', item, item.description)
				let title = ""
				let description = ""

				if (item.description) {
					console.log('有秒速', item.description)
					uni.navigateTo({
						url: '../template/keyboardPay/index?id=' + item.id + '&title=' + item.name +
							'&description=' + item.description + '&createtime=' + item.createtime +
							'&isInOutStatus=1',
					})

				} else {
					title = "调研问卷"
					description = ""
					uni.navigateTo({
						url: '../template/keyboardPay/index?id=' + item.id + '&title=' + title +
							'&description=' + description + '&createtime=' + item.createtime +
							'&isInOutStatus=1',
					})
				}

			},
			// 获取账单列表
			getBillListData: function(params) {
				this.billListData = []
				var that = this;
				uni.request({
					method: 'POST',
					url: 'https://jizhang.xqyu.cn/index.php/api/index/get_bill',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: params,
					success: function(res) {
						// 数据加载完成，隐藏弹窗
						uni.hideLoading();
						if (res.data.code == 1) {
							// 审核测试数据  带后台追加审核字段后删除






							var result = res.data.data; // 时间格式化
							result.forEach((item, index) => {
								if (item.createtime !== null) {
									let time = util.timestampToTime(item.createtime);
									var creatTimeObj = result[index];
									creatTimeObj.createtime = time;
								}
							});
							that.billListData = res.data.data
							console.log('获取记账列表后获取记账列表后获取记账列表后获取记账列表后获取记账列表后', that.billListData)
						}
					}
				});
			},
			// 详情跳转
			urlDetailHome: function(item) {
				console.log('详情跳转了详情跳转了详情跳转了详情跳转了 ', item)

				if (item.col == 2) {
					// 跳转法人详情页
					uni.navigateTo({
						url: '../componentsA/homeDetail/index?item=' + JSON.stringify(item)
					})
				} else {
					// 跳转自然人详情页
					uni.navigateTo({
						url: '../library/divider/index?id=' + item.id + '&col=' + item.col + '&user_type=' +
							item.user_type + '&month=' + item.month + '&type_id=' + item.type_id
					})
				}
			},
			// 是否关闭弹窗 
			onCloseAdvertisement: function() {
				this.isShowAdvertisement = false
				// app.globalData.isShowAdvertisement = false;
			},

			// 查看详情按钮
			detailButton: function() {
				// app.globalData.SHOWTIPS('待开发', 'none');
			},

			// 问点击事件
			onItemClick: function(e) {
				let id = e.currentTarget.dataset.id;
				uni.navigateTo({
					url: '../detail/index?id=' + id
				});
			},
			// 授权
			getList: function() {
				// 获取缓存中是否存在授权后发的用户phone
				var phone = uni.getStorageSync('phone');
				if (!phone) {
					// 如果用户没有手机信息  跳转授权页面进行授权
					uni.navigateTo({
						url: '../componentsB/image/index'
					});
				} else {
					var that = this;
				}
			}
		}
	};
</script>

<style>
	/* page {
		background-color: rgb(240, 242, 244);
	} */
</style>

<style lang="scss" scoped>
	@import '../../common/public.css';

	.success {
		color: #0F9B4D;
	}

	.warning {
		color: #FF8E03;
	}

	.error {
		color: #FC3E2C;
	}

	.margin-top40 {
		margin-top: 40rpx;
	}

	.margin-top160 {
		margin-top: 160rpx;
	}

	.swiper-back {

		//轮播图3d效果区域
		// margin-top: 50rpx;
		.active {
			opacity: 1;
			z-index: 10;
			height: 270rpx;
			width: 75vw;
			top: 7%;
			transition: all 0.2s ease-in 0s;
		}

		.swiper-box {
			height: 150px;
			border-radius: 15rpx !important;
			margin-left: 20rpx;
			margin-right: 20rpx;
			margin-bottom: 20rpx;

			/deep/ .swiper-item.data-v-6f423f94 {
				// border-radius: 15rpx !important;
				//设置轮播图圆角值 覆盖原来的值
			}
		}

		.swiper-item {
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			flex-direction: column;
			justify-content: center;
			align-items: center;
			background-color: #999;
			color: #fff;
			// border-radius: 15rpx !important;
		}

		/deep/.image {
			width: 100%;
			// border-radius: 15rpx !important;
			height: 100%;
		}
	}

	.tab {
		// margin: 40rpx 20rpx;
		border-radius: 15rpx;
		margin-top: -135rpx;
		margin-left: 20rpx;
		position: relative;
		z-index: 1000;

		button {
			background: linear-gradient(159deg, #80e6fc 0%, #0051ff 99%);
		}

		.tab-img {
			height: 80rpx;
			width: 80rpx;
			background-color: #EAF2F3;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 10rpx;
			margin-right: 20rpx;
		}

		.active {
			color: #0796FE !important;
			background-color: #FFFFFF !important;
			border-top-left-radius: 15rpx !important;
			border-top-right-radius: 15rpx !important;
		}

		.borderLeft {
			border-bottom-right-radius: 15rpx !important;
		}

		.borderRight {
			border-bottom-left-radius: 15rpx !important;
		}

		.default {
			flex: 1;
			background-color: #078AFE;
			border-top-right-radius: 15rpx;
			border-top-left-radius: 15rpx;
			color: #FFFFFF;
			padding: 15rpx 33rpx;
		}

		.tab-content {
			background-color: #FFFFFF;
		}
	}

	.swiper {
		margin-top: 135rpx;
		margin-right: 20rpx;
		margin-left: 20rpx;
	}

	.u-cell-icon {
		width: 36rpx;
		height: 36rpx;
		margin-right: 8rpx;
	}

	page {
		background-color: #f7f7f7;
		padding-bottom: 50rpx;
	}

	.head {
		height: 415rpx;
		z-index: 1;
	}

	.message-img {
		right: 0;
		top: 50rpx;
		right: 50rpx;

		image {
			width: 50rpx;
			height: 50rpx;
		}

		.p_r {
			.message-img-gif {
				width: 20rpx;
				height: 20rpx;
				border-radius: 50%;
				background-color: red;
				margin-top: -65rpx;
				margin-left: 35rpx;
				box-shadow: 10px 10px 10px rgba(0, 0, 0, .5);
				animation: scaleDraw 3s ease-in-out infinite;
			}

			@keyframes scaleDraw {

				/*定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称*/
				0% {
					transform: scale(1);
					/*开始为原始大小*/
				}

				25% {
					transform: scale(1.5);
					/*放大1.1倍*/
				}

				50% {
					transform: scale(1);
				}

				75% {
					transform: scale(1.5);
				}
			}
		}
	}

	.content {
		padding: 20rpx 0;
		margin-left: 30rpx;
		margin-right: 30rpx;
		border-radius: 20rpx;
		margin-top: 30rpx;
		background-color: #ffffff;

		.bill-img {
			width: 90rpx;
			height: 90rpx;
			border-radius: 15rpx;
			background-color: #ECF1F7;
		}
	}

	.item {
		border-bottom: 1px #e5e5e5 solid;
		margin-left: 30rpx;
		margin-right: 30rpx;
	}

	.item:last-child {
		border-bottom: 0;
	}

	.item image {
		width: 50rpx;
		height: 50rpx;
	}

	text {
		display: block;
	}

	.money {
		font-weight: bold;
	}

	.title {
		font-weight: bold;
	}

	.txt {
		font-weight: bold;
		padding-left: 30rpx;
		color: #333;
	}

	//暂时不删除
	.gundong-section {
		height: 230rpx;
		margin-left: 20rpx;
		margin-right: 20rpx;
		margin-top: 105rpx;
	}

	.gundong-section .swiper-position {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 2;
		height: 80rpx;
		overflow: hidden;
		right: 20rpx;
	}

	.swiperitem {
		height: 100%;
		margin-left: 2rem;
	}

	.swiperview .wx-swiper-dots {
		display: none;
	}

	.swiper-txt {
		color: #333;
		line-height: 88rpx;
	}

	.popup-img {
		width: 580rpx;
	}

	.popup-image {
		width: 100%;
		height: 565rpx;
	}

	.button-detail {
		width: 468rpx;
		height: 80rpx;
		background: linear-gradient(159deg, #1fd5fc 0%, #0452c6 99%);
		box-shadow: 0px 8px 9px 1px rgba(23, 122, 251, 0.17000000178813934);
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #ffffff;
		margin-top: 45rpx;
		margin-bottom: 37rpx;
	}
</style>
